Skip to content

feat(app push): add --build-tag flag for custom image tags#2909

Open
kwiatekus wants to merge 11 commits intokyma-project:mainfrom
kwiatekus:app-push-add-image-tag-flag
Open

feat(app push): add --build-tag flag for custom image tags#2909
kwiatekus wants to merge 11 commits intokyma-project:mainfrom
kwiatekus:app-push-add-image-tag-flag

Conversation

@kwiatekus
Copy link
Copy Markdown
Contributor

@kwiatekus kwiatekus commented May 7, 2026

Summary

  • Adds --build-tag flag to kyma app push allowing users to supply a custom Docker image tag when building from source (--code-path or --dockerfile)
  • Falls back to the existing timestamp-based tag when the flag is omitted (no behaviour change for existing users)
  • Flag is mutually exclusive with --image (which already embeds the tag)
  • Tag is validated against Docker tag rules: starts with [a-zA-Z0-9_], only [a-zA-Z0-9_.-] allowed, max 128 chars

Motivation

Enables CI/CD pipelines to use deterministic, traceable image tags:

kyma app push --name my-app --code-path . --build-tag ${{ github.sha }}

Closes #2907

Test Plan

  • go test ./internal/cmd/app/... -v — 15 tests pass (13 validation cases + 2 resolveImageTag cases)
  • go build ./... — no errors
  • Manual: kyma app push --name my-app --code-path . --build-tag abc1234 uses tag abc1234
  • Manual: kyma app push --name my-app --code-path . still uses timestamp tag (no regression)
  • Manual: kyma app push --name my-app --image myimage:latest --build-tag abc fails with exclusivity error
  • Manual: kyma app push --name my-app --code-path . --build-tag "bad tag" fails with clear validation error

@kwiatekus kwiatekus requested a review from a team as a code owner May 7, 2026 05:50
@kwiatekus kwiatekus added this to the 3.5.0 milestone May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

✅ Proposed changes verification passed

This pull request comes with up-to-date documentation and no illegal standard output usages.

Find more detailed information in the verify / standards (pull_request_target) action.

@kwiatekus kwiatekus changed the title feat(app push): add --image-tag flag for custom image tags feat(app push): add --build-tag flag for custom image tags May 7, 2026
@kwiatekus kwiatekus requested a review from a team as a code owner May 7, 2026 06:03
Comment thread internal/cmd/app/push.go
}
}

if apc.buildTag != "" {
Copy link
Copy Markdown
Contributor

@musztardem musztardem May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lives in the complete method which as I understand is responsible for populating config data based on some logic. We don't populate the buildTag here but rather check if it's complaint with regex so I would move this piece to the validate method

@kwiatekus kwiatekus assigned kwiatekus and unassigned musztardem May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

app push: allow custom image tag via --build-tag flag

3 participants